package com.itsu.job.components;

/**
 * @author Jerry.Su
 * @Date 2022/2/8 16:25
 */
public class Const {

    public static final String HTTP_URL_REGEX =
            "(ht)tp(s?)\\:\\/\\/[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\.\\?\\,\\'\\/\\\\&%\\+\\$#_=]*)?";

    public static final String LOCAL_IP = "127.0.0.1";

    public static final String LOCAL_HOST = "localhost";

    /**
     * 锁前缀
     */
    public static String LOCK_PREFIX = "itsu_job_lock:";

    /**
     * 锁存活时间 毫秒
     */
    public static Long LOCK_EXPIRE = 5 * 1000L;

    /**
     * 锁等待时间 毫秒
     */
    public static Long LOCK_WAIT = 3 * 1000L;

    public static final String REGISTER_RPC_NODES = "REGISTER_RPC_NODES";

    public static final String RPC_NODE_SPLIT = ",";

    public static final String TOKEN_HEADER_KEY = "x-rpc-token";

    public static final String REGISTER_URI = "/register";

    public static final String UP_STATUS = "UP";

    public static final String DOWN_STATUS = "DOWN";
}
